package com.yckj.day06;

/**
 * TODO
 *
 * @author shengyuee
 * @version 1.0
 * 2025/7/23 16:05
 */
public class TeacherTest {
    public static void main(String[] args) {
        Teacher teacher = new Teacher();
        teacher.setName("张三");
//        teacher.setAge(-12); // 不合要求的值无法设置
        teacher.setAge(20);
        teacher.setSex("男");
        System.out.println(teacher); // 默认调用toString()
        System.out.println(teacher.toString());
        String name = teacher.getName();
        int age = teacher.getAge();
        String sex = teacher.getSex();
        System.out.println(name+","+age);
    }
}
